#ifndef DAMECHINOISE_H
#define DAMECHINOISE_H

#include <QMainWindow>
#include <QtCore>
#include <QtGui>
#include <qpainter.h>
#include <qpen.h>
#include <qhash.h>
#include "cercle.h"
#include <QTcpSocket>
#include "reseau.h"
#include "joueur.h"

namespace Ui {
    class DameChinoise;
}

class DameChinoise : public QMainWindow
{
    Q_OBJECT

public:
    explicit DameChinoise();
    ~DameChinoise();
    void paintEvent(QPaintEvent *e);
    void initEtoile();
    void initCouleur();
    void colorierZoneA(int x, int y, couleur c);
    void colorierZoneB(int x, int y, couleur c);
    void gererDeplacement(int x, int y);
    void setLabelText(QString texte);
    void setIP(QString IP);
    void setNumeroPort(int num);
    void setReseau(Reseau *r);
    void setListPseudo();
    void setListScore();
    void setListCouleur();
    void setPseudo(QString pseudo);
    void effectuerDeplacement(QString message);
    void setMessage(QString m);
    QString donneesRecues();

 public slots:
    void validerDeplacement();
    void annulerDeplacement();
    void dessinerCercle(int x, int y );

public:
    Ui::DameChinoise *fendame;
    int r;
private:
    QString pseudo;
    QString serveurIP;
    QString msgDep;
    Reseau *reseau;
    QVector<QString> m_listPseudo;
    QHash <int , Cercle*> hash;
    QList<Cercle> liste;
    bool flag;
    QPoint source;
    QPoint des;
    QPoint desant;
    QPoint sourceant;
    QTcpSocket *socket;
    quint16 tailleMessage;
    int serveurPort;
    int montour;
    int nbDep;
    QList<Joueur*> listJoueurs;
 protected:
    void closeEvent(QCloseEvent *event);
    void keyPressEvent(QKeyEvent * event);
};

#endif // DAMECHINOISE_H
